/*
 * ListenerToGPS.java
 *
 * Created on 8 juin 2007, 18:05
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package courselog;

import courselog.gpsutils.ReceiverEvent;
import courselog.gpsutils.SerialGPSConnection;
import ewe.ui.Event;
import ewe.ui.EventListener;

/**
 * Listens to the GPS, update the track if needed and forward values to other 
 * elements of the MainApp.
 * 
 * @author CourseLog
 */
public class ListenerToGPS implements EventListener {
    
    /** The main courselog application */
    public MainApplication myApp;
    
    // CONSTRUCTOR
    
    /**
     * Creates a new instance of ListenerToGPS for a main application
     */
    public ListenerToGPS(MainApplication app) {
        myApp=app;
        app.getMySGC().setListener(this);
    }
    
    // ACCESSORS
    
    // INTERFACE METHODS

    /**
     * Get Events from the GPS connection
     */
    public void onEvent(Event ev) {
        if(ev instanceof ReceiverEvent) {
            ReceiverEvent rEv= (ReceiverEvent) ev;
            if(rEv.type==ReceiverEvent.STATUSCHANGED) {
                
            }else if(rEv.type==ReceiverEvent.NEWPOINT){
                
            }
        }
    }
    
    // CLASS METHODS

    /**
     * Pause track logging.
     */
    public void pauseTracking() {
        
    }
}
